jQuery('#filtro').jqGrid(
	{
		url:'<?php echo site_url($this->url."grid") ?>',
		datatype: 'json',
		colNames:['<?php echo $this->lang->line("G_CLAVE") ?>', '<?php echo $this->lang->line("G_VALOR") ?>', '<?php echo $this->lang->line("G_DESCRIP") ?>'],
		colModel:[
			{
				name :'clave'         ,
				index:'clave'         ,
				width:55              ,
				key  :true
			},
			{
				name :'valor'         ,
				index:'valor'         ,
				width:90
			},
			{
				name :'descrip'       ,
				index:'descrip'       ,
				width:100
			},
		],
		rowNum     :10                                ,
		width      :700                               ,
		rowList    :[10,20,30]                        ,
		pager      : '#barra'                         ,
		sortname   : 'clave'                          ,
		viewrecords: true                             ,
		sortorder  : 'desc'                           ,
		caption    : '<?php echo $this->lang->line("G_CAPTION") ?>',
		height     : '100%'
	}
);

jQuery('#filtro').jqGrid(
	'navGrid'                      ,
	'#barra'                       ,
	{
		edit:false,
		add :false,
		del :false,
		view:true
	},
	{},
	{},
	{},
	{
		multipleSearch:true,
		multipleGroup :true,
		showQuery     :true
	}
);

var a='';
function print_r(theObj){
   if(theObj.constructor == Array || theObj.constructor == Object){
      a=a+"<ul>";
      for(var p in theObj){
         if(theObj [p] .constructor == Array || theObj [p] .constructor == Object){
            a=a+"<li> ["+p+"]  => "+typeof(theObj)+"</li>";
            a=a+"<ul>";
            print_r(theObj [p] );
            a=a+"</ul>";
         } else {
            a=a+"<li> ["+p+"]  => "+theObj [p] +"</li>";
         }
      }
      a=a+"</ul>";
   }
}

$(function (){
	ide = 'TITLE';
	$('#config_editar').click(function(){
		
		html='<p>assasaas</p>';
		var d = $('<div id="div_config_'+ide+'" ><div>');
        
		$('#div_config_'+ide).html(html);
		html=$('#div_config_'+ide).html();
		print_r(d);
		alert(a);
		
		$('#div_config_'+ide).dialog();
	});
});



